<?
session_start();
error_reporting(E_ALL);
require_once("../function/database.php");
require_once("../function/date_functions.php");
require_once("../function/file_functions.php");
require_once("../function/functions.php");
require_once("../function/html_cleanup.php");
require_once("../function/pagebreak.php");
require_once("../function/resize_image.php");
require_once("../function/upload.php");

$admin_id 				= getValue("user_id","int","SESSION");
$isAdmin 				= getValue("isAdmin","int","SESSION");


$meta_title = 'Quản trị web';
$js_global  = '';
$css_global  = '';

$css_global  .= '<link href="theme/css/bootstrap.css" rel="stylesheet" type="text/css">';
$css_global  .= '<link href="theme/css/bootstrap.min.css" rel="stylesheet" type="text/css">';
$css_global  .= '<link href="theme/css/bootstrap-responsive.css" rel="stylesheet" type="text/css">';
$css_global  .= '<link href="theme/css/bootstrap-responsive.min.css" rel="stylesheet" type="text/css">';
$css_global  .= '<link href="theme/css/edu.css" rel="stylesheet" type="text/css">';
$css_global  .= '<link href="theme/css/uniform.css" rel="stylesheet" type="text/css">';

$js_global   .= '<script language="javascript" src="theme/js/jquery.js"></script>';
$js_global   .= '<script language="javascript" src="theme/js/actions.js"></script>';
$js_global   .= '<script language="javascript" src="theme/js/bootstrap.js"></script>';
$js_global   .= '<script language="javascript" src="theme/js/bootstrap.min.js"></script>';
$js_global   .= '<script language="javascript" src="theme/js/check-all.js"></script>';
$js_global   .= '<script language="javascript" src="theme/js/uniform.js"></script>';


function checkLogin($username, $password){
	$username	= replaceMQ($username);
	$password	= replaceMQ($password);
	$adm_id		= 0;
   
	$db_check	= new db_query("SELECT adt_id 
										 FROM administrator
										 WHERE adt_username = '" . $username . "' AND adt_password = '" . md5($password) . "' AND adt_status = 1");
	
   if(mysql_num_rows($db_check->result) > 0){
		$check	= mysql_fetch_array($db_check->result);
		$adt_id	= $check["adt_id"];
		$db_check->close();
		unset($db_check);
		return $adt_id;
	}
	else{
		$db_check->close();
		unset($db_check);
		return 0;
	}
}
function checklogged($denypath = ""){ 
    if($denypath == ""){
        $denypath="../../login.php"; 
        $password = getValue("password", "str", "SESSION", ""); 
        $username = getValue("userlogin", "str", "SESSION", ""); 
        $user_id = getValue("user_id", "str", "SESSION", ""); 
        $checsum = getValue("checsum", "str", "SESSION", "");
    }
}
?>